package org.apache.guacamole.auth;

import com.google.inject.AbstractModule;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.auth.connection.ConnectionService;
import org.apache.guacamole.auth.user.UserDataService;
import org.apache.guacamole.environment.Environment;
import org.apache.guacamole.environment.LocalEnvironment;
import org.apache.guacamole.net.auth.AuthenticationProvider;

public class ArchempowerAuthenticationProviderModule extends AbstractModule {

    private final Environment environment;

    private final AuthenticationProvider authProvider;

    public ArchempowerAuthenticationProviderModule(AuthenticationProvider authProvider)
            throws GuacamoleException {

        // Get local environment
        this.environment = new LocalEnvironment();

        // Store associated auth provider
        this.authProvider = authProvider;

    }

    @Override
    protected void configure() {
// Bind core implementations of guacamole-ext classes
        bind(AuthenticationProvider.class).toInstance(authProvider);
        bind(Environment.class).toInstance(environment);

        bind(ConnectionService.class);
        bind(UserDataService.class);
    }
}
